//
//  TEAppHelper.m
//  ThaiExpress
//
//  Created by Le Quang Vinh on 7/11/13.
//  Copyright (c) 2013 Fruity. All rights reserved.
//

#import "TEAppHelper.h"

#pragma mark Logs

/*
 * add extended information on a classical NSLog command
 */
void extendedLog(NSString* extendedInfo, NSString* format, ...)
{
	va_list argumentList;
	va_start(argumentList, format);
    
    NSLogv([extendedInfo stringByAppendingString:format], argumentList);
	
	va_end(argumentList);
}

@implementation TEAppHelper

+ (NSString *)currentVersion {
    return [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
}

+ (NSString *)applicationDocumentDirectory {
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    if(paths.count > 0) {
        return [paths objectAtIndex:0];
    } else return nil;
}


@end